/*
 * Copyright 2020-2099 sa-token.cc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.com.idmy.auth.context;

import cn.com.idmy.base.model.NameValue;
import com.alibaba.fastjson2.JSONObject;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import java.util.List;

/**
 * 对 Response 包装类的实现（Jakarta-Servlet 版）
 *
 * @author click33
 * @since 1.34.0
 */
public class ResponseForThreadLocal implements Response {

    /**
     * 获取底层源对象
     */
    @Override
    public @NotNull Object source() {
        return new JSONObject();
    }

    /**
     * 设置响应状态码
     */
    @Override
    public @NotNull Response status(int status) {
        return this;
    }

    /**
     * 在响应头里写入一个值
     */
    @Override
    public @NotNull Response setHeader(@NotNull String name, @NotNull String value) {
        return this;
    }

    /**
     * 在响应头里添加一个值
     *
     * @param name  名字
     * @param value 值
     * @return 对象自身
     */
    @Override
    public @NotNull Response addHeader(@NotNull String name, @NotNull String value) {
        return this;
    }

    /**
     * 重定向
     */
    @Override
    public void redirect(@NotNull String url) {
    }

    @Override
    public @NotNull Collection<String> headerNames() {
        return List.of();
    }

    @Override
    public @NotNull Collection<String> headerValues() {
        return List.of();
    }

    @Override
    public @NotNull Collection<NameValue<String>> headers() {
        return List.of();
    }
}
